package com.kgc.ubatnet.ubatnetitemweb.controller;

import com.kgc.ubatnet.bean.PmsSkuInfo;
import com.kgc.ubatnet.service.SkuService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author shkstart
 * @create 2020-09-20 16:42
 */
@Controller
public class ItemController {


    @Reference
    SkuService skuService;

    @RequestMapping("{skuId}.html")
    public  String item(@PathVariable Long skuId, Model model){
        PmsSkuInfo item=skuService.selectBySkuId(skuId);
        model.addAttribute("skuInfo",item);

        return "item_show";
    }

    @RequestMapping("/index")
    public String test(){
        return "index";
    }

    @RequestMapping("/item")
    public String itemShow(){
        return "item_show";
    }

}
